package com.songlanyun.modules.supplychainapi.controller;

import com.songlanyun.common.supplychainapi.logistic.ApiLogisticCommon;
import com.songlanyun.common.supplychainapi.logistic.model.Logistic;
import com.songlanyun.common.supplychainapi.logistic.model.LogisticFirms;
import com.songlanyun.common.supplychainapi.order.ApiOrderCommon;
import com.songlanyun.common.supplychainapi.order.model.*;
import com.songlanyun.common.utils.R;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("api/supplychain/logistic")
public class SupplyChainLogisticAdminController extends AbstractController {

    @Resource
    private ApiLogisticCommon apiLogisticCommon;


    /**
     * 物流查询v2
     */
    @GetMapping("query")
    public R listErrorNew(@RequestParam Map<String, Object> params) {
        Logistic logistic = apiLogisticCommon.logistic(params);
        return R.ok().put("data", logistic);
    }

    /**
     * 获取物流公司列表V2
     */
    @GetMapping("firms")
    public R firms() {
        LogisticFirms[] logisticFirms = apiLogisticCommon.logisticFirms();
        return R.ok().put("data", logisticFirms);
    }

}
